package com.cjw.demo.controller;


import com.cjw.demo.entity.TbRoomReservation;
import com.cjw.demo.vo.Vo;
import com.cjw.demo.service.ITbRoomReservationService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 预约房源表 前端控制器
 * </p>
 *
 * @author cjw
 * @since 2021-11-18
 */
@RestController
@RequestMapping("/reservation")

public class TbRoomReservationController {

    @Autowired
    ITbRoomReservationService iTbRoomReservationService;

    @RequestMapping("list")
    public PageInfo<TbRoomReservation> listreq(@RequestParam(defaultValue = "1")Integer pageNum, @RequestParam(defaultValue = "10")Integer pageSize, Vo vo){

        PageHelper.startPage(pageNum,pageSize);

        List<TbRoomReservation> list = iTbRoomReservationService.lists(vo);

        PageInfo<TbRoomReservation> info = new PageInfo<>(list);

        return info;
    }








}
